package com.qf.config;

import com.github.wxpay.sdk.WXPayConfig;
import org.springframework.context.annotation.Configuration;

import java.io.InputStream;

/**
 * <p>@user HopeULife</p>
 * <p>@date 2021/11/1</p>
 */

/**
 * 微信支付相关配置
 */
@Configuration
public class MyWXPayConfig implements WXPayConfig {

    private String appId;//appid
    private String key;//商户key
    private String mchId;//商户id

    public MyWXPayConfig(AppProperties appProperties) {
        this.appId = appProperties.getWxpay().getAppId();
        this.key = appProperties.getWxpay().getKey();
        this.mchId=appProperties.getWxpay().getMchId();
    }

    @Override
    public String getAppID() {
        return appId;
    }

    @Override
    public String getMchID() {
        return mchId;
    }

    @Override
    public String getKey() {
        return key;
    }

    @Override
    public InputStream getCertStream() {
        return null;
    }

    @Override
    public int getHttpConnectTimeoutMs() {
        return 0;
    }

    @Override
    public int getHttpReadTimeoutMs() {
        return 0;
    }
}
